/**
 * 
 */
package cre.gutwo.util;

import cre.gutwo.swing.JPrintStream;

import java.io.PrintStream;

/**
 * @author Cre.Gu
 *
 */
public class FrameUtil {

	private static JPrintStream out;
	private static PrintStream printStream;

	public static void setOut(JPrintStream out) {
		FrameUtil.out = out;
	}

	public static void setPrintStream(PrintStream printStream) {
		FrameUtil.printStream = printStream;
	}

	public static void println(String message) {
		if (out != null)
			out.println(message);

		if (printStream != null) {
			printStream.println(message);
		}
	}

	public static void alert() {
		if (out != null)
			out.alert();
	}

	public static void begin() {
		if (out != null)
			out.begin();
	}

}
